package cn.com.jrj.base.util;

import java.util.Locale;
import java.util.ResourceBundle;

public class ConfigUtil {
	private static final String file = "config";

	private static final ConfigUtil instance = new ConfigUtil();

	public static ConfigUtil getInstance() {
		return instance;
	}

	public ResourceBundle loadFile(String file) {
		try {
			return ResourceBundle.getBundle(file, Locale.ENGLISH);
		} catch (Exception e) {
			e.printStackTrace();
			System.err.println("[Property]:Can't Load property.properties");
			return null;
		}
	}

	public String getString(String key) {
		try {
			String value = loadFile(file).getString(key);
			return value;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

}
